#coding:utf-8
class UserSessionsController < ApplicationController
  before_filter :authenticate, :only => :destroy
=begin
 创建user session
=end  
  def new
    @user_session = UserSession.new
  end
  
=begin
  登录
=end
  def create
    @user_session = UserSession.new(params[:user_session])
    if @user_session.save
      redirect_to root_path
    else
      render :new
    end
  end
  
=begin
 注销
=end
  def destroy
    @user_session = UserSession.find
    @user_session.destroy
    redirect_to new_user_session_path
  end
end
